package com.puzzlebazar.client.squaregrid.view;

import com.google.gwt.user.client.ui.AbsolutePanel;
import com.puzzlebazar.client.util.Vec2i;

public class FillDrawable extends Drawable {

	/**
	 * Creates an image-based drawable
	 * 
	 * @param name Name of the drawable for future reference (can be null)
	 * @param style The CSS style to use (can be a space separated list)
	 */
	public FillDrawable(String name, String style) {
		super(name);
		setStyle( style );
	}

	/**
	 * Creates an image-based drawable within a single cell
	 * 
	 * @param loc Location of the cell
	 * @param name Name of the drawable for future reference (can be null)
	 * @param style The CSS style to use (can be a space separated list)
	 */
	public FillDrawable(Vec2i loc, String name, String style) {
		super(loc, name);
		setStyle( style );
	}

	/**
	 * Sets the URL of the image for this drawable. Must be set 
	 * once and never modified 
	 * 
	 * @param style The CSS style to use (can be a space separated list)
	 */
	private void setStyle( String style ) {
		AbsolutePanel widget = new AbsolutePanel();
		widget.setStylePrimaryName(style);
		setWidget(widget);
	}

	
}
